// permission-api.entity.ts
import {
  Column,
  Entity,
  JoinColumn,
  OneToOne,
  PrimaryGeneratedColumn,
} from 'typeorm';
import { Permission } from '@/permission/entities/permission.entity';

@Entity()
export class PermissionApi {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  apiUrl: string;

  @Column()
  apiMethod: string;

  @OneToOne(() => Permission, (permission) => permission.permissionApi)
  @JoinColumn({
    name: 'permission_id',
  })
  permission: Permission;
}
